<template>
	<view class="notice-container full-container">
		<!-- <up-sticky bgColor="#fff">
		    <up-tabs :list="list" lineWidth="30" :itemStyle="{width:'50%',height: '44px'}" @change="changeTab"></up-tabs>
		</up-sticky> -->
		
		<view class="ads">
			<u-image src="/static/images/banner/banner.jpg" mode="aspectFill" width="100%" height="220rpx"></u-image>
		</view>
		
		<geek-list ref="list" :api="fetchNoticeList" isPage>
			<block #default="{item}">
				<uni-card shadow="none" :title="item.noticeTitle" :sub-title="item.createTime" @click="$tab.navigateTo(`/pages/notice/detail?id=${item.noticeId}`)">
					<!-- <up-text :text="item.noticeContent" :lines="2" size="14" type="info"></up-text> -->
					<up-parse :content="item.noticeContent"></up-parse>
				</uni-card>
			</block>
		</geek-list>
	</view>
</template>

<script>
	import {getNoticeList} from '@/api/system/user'
	
	export default{
		data(){
			return {
				// currType:1,
				list:[  
					{ name: '通知', value:1 },  
					{ name: '公告', value:2 }
				]
			}
		},
		
		methods:{
			// changeTab(obj){
			// 	this.currType = obj?.value
			// },
			
			fetchNoticeList(data){
				// data.noticeType = this.currType
				return getNoticeList(data)
			}
		},
		
		// watch:{
		// 	currType(){
		// 		this.$refs.list.resetList()
		// 	}
		// }
	}
</script>

<style lang="scss" scoped>
	.notice-container{
		.ads{
			width: 100%;
		}
		
		&::v-deep{
			.uni-card__content {
				padding: 24rpx;
				font-size: 30rpx;
				color:#898989;
				line-height: 1.6;
				text-indent: 2em;
				p {
					display: -webkit-box !important;
					overflow: hidden;
					text-overflow: ellipsis;
					word-break: break-all;
					-webkit-line-clamp: 2;
					-webkit-box-orient: vertical !important;
				}
			}
			
			.uni-card__header-content-title{
				font-size: 32rpx !important;
				font-weight: bold;
				margin-bottom: 6rpx;
			}
			
			.uni-card__header-content-subtitle{
				font-size: 28rpx !important;
			}
			
			.u-text__value{
				font-size: 30rpx !important;
			}
		}
	}
</style>